package com.hnkywl.sts.entity.organ;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.base.Lxr;
import com.hnkywl.sts.entity.cggl.Cgd;
import com.hnkywl.sts.entity.sys.Yg;
import com.hnkywl.sts.entity.xsgl.Xsd;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * 说明：仓库
 * 包:        com.hnkywl.sts.entity.organ
 * 类描述:    仓库
 * 修改备注: [说明本次修改内容]
 * 版本:        [v1.0]
 */
@Entity
@Table(name="T_SYS_CK")
@Where(clause = "deleted!='1'")
public class Ck extends BaseEntity{
    @Id
    @SequenceGenerator(name = "seqCk", allocationSize = 1, sequenceName = "SEQ_SYS_CK")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqCk")
    private Long id;

    /**
     * 编号
     */
    private String bh;

    /**
     * 名称
     */
    private String mc;

    /**
     * 助记码
     */
    private String zjm;

    /**
     * 所属公司机构
     */
    @ManyToOne
    @JoinColumn(name="SSGS_ID")
    @Where(clause = "deleted!='1'")
    @NotFound(action= NotFoundAction.IGNORE)
    private Nbgs ssgsjg;

    /**
     * 所属供应站
     */
    @ManyToOne
    @JoinColumn(name="SSGYZ_ID")
    @Where(clause = "deleted!='1'")
    private Nbbm ssgyz;

    @ManyToMany( cascade = {CascadeType.ALL},
            mappedBy = "khckList",//相等于inverse
            targetEntity = Nbbm.class)
    @Where(clause = "deleted!=1")
    private List<Nbbm> ssbmList;

    /**
     * 人员列表
     */
    @ManyToMany(fetch = FetchType.LAZY,mappedBy = "ckList")
    private List<Yg> ygList;

    /**
     * 采购单
     */
    @OneToMany(fetch = FetchType.LAZY, targetEntity = Cgd.class, mappedBy = "dzck")
    @NotFound(action = NotFoundAction.IGNORE)
    private List<Cgd> cgdList;

    /**
     * 销售单
     */
    @OneToMany(fetch = FetchType.LAZY, targetEntity = Xsd.class, mappedBy = "thck")
    @NotFound(action = NotFoundAction.IGNORE)
    private List<Xsd> xsdList;

    /**
     * 仓库级别
     */
    private Integer ckjb;

    /**
     * 地址
     */
    private String dz;

    /**
     * 联系人
     */
    private String lxr;

    /**
     * 联系电话
     */
    private String lxdh;
    /**
     * 是否注销
     */
    private Boolean sfzx = false;

    /**
     * 传真
     */
    private String cz;

    /**
     * 出库费
     */
    private Float ckf;

    /**
     * 过户费
     */
    private Float ghf;

    /**
     * 加班费
     */
    private Float jbf;

    /**
     * 出库费是否取整
     */
    private Boolean ckfsfqz;

    /**
     * 加班费是否取整
     */
    private Boolean jbfsfqz;

    /**
     * 排序号
     */
    private Integer pxh;

    /**
     * 区域
     */
    private Integer qy;

    public Boolean getSfzx() {
        return sfzx;
    }

    public void setSfzx(Boolean sfzx) {
        this.sfzx = sfzx;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getBh() {
        return bh;
    }

    public void setBh(String bh) {
        this.bh = bh;
    }

    public String getMc() {
        return mc;
    }

    public void setMc(String mc) {
        this.mc = mc;
    }

    public String getZjm() {
        return zjm;
    }

    public void setZjm(String zjm) {
        this.zjm = zjm;
    }

    public Nbgs getSsgsjg() {
        return ssgsjg;
    }

    public void setSsgsjg(Nbgs ssgsjg) {
        this.ssgsjg = ssgsjg;
    }

    public Nbbm getSsgyz() {
        return ssgyz;
    }

    public String getLxr() {
        return lxr;
    }

    public void setLxr(String lxr) {
        this.lxr = lxr;
    }

    public void setSsgyz(Nbbm ssgyz) {
        this.ssgyz = ssgyz;
    }

    public List<Nbbm> getSsbmList() {
        return ssbmList;
    }

    public void setSsbmList(List<Nbbm> ssbmList) {
        this.ssbmList = ssbmList;
    }

    public List<Cgd> getCgdList() {
        return cgdList;
    }

    public void setCgdList(List<Cgd> cgdList) {
        this.cgdList = cgdList;
    }

    public List<Xsd> getXsdList() {
        return xsdList;
    }

    public void setXsdList(List<Xsd> xsdList) {
        this.xsdList = xsdList;
    }

    public Integer getCkjb() {
        return ckjb;
    }

    public void setCkjb(Integer ckjb) {
        this.ckjb = ckjb;
    }

    public String getDz() {
        return dz;
    }

    public void setDz(String dz) {
        this.dz = dz;
    }

    public String getLxdh() {
        return lxdh;
    }

    public void setLxdh(String lxdh) {
        this.lxdh = lxdh;
    }

    public String getCz() {
        return cz;
    }

    public void setCz(String cz) {
        this.cz = cz;
    }

    public Float getCkf() {
        return ckf;
    }

    public void setCkf(Float ckf) {
        this.ckf = ckf;
    }

    public Float getGhf() {
        return ghf;
    }

    public void setGhf(Float ghf) {
        this.ghf = ghf;
    }

    public Float getJbf() {
        return jbf;
    }

    public void setJbf(Float jbf) {
        this.jbf = jbf;
    }

    public Boolean getCkfsfqz() {
        return ckfsfqz;
    }

    public void setCkfsfqz(Boolean ckfsfqz) {
        this.ckfsfqz = ckfsfqz;
    }

    public Boolean getJbfsfqz() {
        return jbfsfqz;
    }

    public void setJbfsfqz(Boolean jbfsfqz) {
        this.jbfsfqz = jbfsfqz;
    }

    public Integer getPxh() {
        return pxh;
    }

    public void setPxh(Integer pxh) {
        this.pxh = pxh;
    }

    public Integer getQy() {
        return qy;
    }

    public void setQy(Integer qy) {
        this.qy = qy;
    }

    public List<Yg> getYgList() {
        return ygList;
    }

    public void setYgList(List<Yg> ygList) {
        this.ygList = ygList;
    }
}
